//
//  TMLocation.h
//  TMFind
//
//  Created by rxk on 2018/9/10.
//  Copyright © 2018年 Tianma. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>


#pragma mark ---使用系统定位
/**
 定位状态

 - TMLocationStatusUnknown: 未知
 - TMLocationStatusLocationing: 定位中
 - TMLocationStatusSuccess: 定位成功
 - TMLocationStatusFail: 定位失败
 */
typedef NS_ENUM(NSUInteger, TMLocationStatus) {
    TMLocationStatusUnknown,
    TMLocationStatusLocationing,
    TMLocationStatusSuccess,
    TMLocationStatusFail,
};

@class TMGPSAddressModel;

typedef void(^LocationComplate)(NSString *provinces, NSString *city, NSString *county, NSError *error);

typedef void(^LocationModelComplate)(TMGPSAddressModel * adModel, NSError *error);

@interface TMLocation : NSObject

/**
 定位状态
 */
@property (nonatomic, assign) TMLocationStatus locationStatus;

///经纬度信息
@property (nonatomic, assign) CLLocationCoordinate2D destination;

/**
 省份
 */
@property (nonatomic, strong) NSString *provinces;

/**
 市州（如果是直辖市则为nil）
 */
@property (nonatomic, strong) NSString *city;

/**
 区县
 */
@property (nonatomic, strong) NSString *county;





+ (TMLocation *)instance;

///通过系统gps拿到定位信息
- (void)tm_startLocationWithComplate:(LocationComplate)complate;

///通过系统定位传入腾讯地图api拿到定位相关信息
- (void)tm_startLocationModelWithComplate:(LocationModelComplate)complate;

@end

#pragma mark ---TMGPSAddressModel

@interface TMGPSAddressModel : NSObject
///省
@property (nonatomic, copy) NSString *province;
///市
@property (nonatomic, copy) NSString *city;
///区
@property (nonatomic, copy) NSString *district;
///街道
@property (nonatomic, copy) NSString *street;
///街道号
@property (nonatomic, copy) NSString *street_number;
///地区编码
@property (nonatomic, copy) NSString *adcode;
///经度
@property (nonatomic, copy) NSString *lng;
///纬度
@property (nonatomic, copy) NSString *lat;


@end
